﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using VitCode.BaseDataPageCreator;
using VitCode.BaseDataPageCreator.Setting;

namespace VitCode.Web.BaseData.Helper
{
    public class WebSaveHelper:PageSaveHelper
    {
        public WebSaveHelper(Page page, string settingXmlPath) : base(page, settingXmlPath)
        {
            m_Page = page;
            m_RuleHelper = new PageRuleHelper(settingXmlPath);
            m_LoadHelper = new PageLoadHelper(settingXmlPath);
            m_XmlReader = new ObjXmlReader(settingXmlPath);
            m_PageBuilder = new PageBuilder(m_Page, settingXmlPath);
        }

        public DateTime GetDeadlineTime(DateTime timeNow)
        {
            var endTime = timeNow.AddYears(5);
            endTime = endTime.AddDays(-1);
            var strTime = endTime.ToString("yyyy-MM-dd") + " 23:59:59";
            endTime = Convert.ToDateTime(strTime);
            return endTime;
        }
    }
}
